package abstrac_class_and_interface;

public class TestCompare {
	public static Comparable max(Comparable o1, Comparable o2) {
		if(o1.compareTo(o2) > 0)
			return o1;
		else 
			return o2;
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ComparableRectangle cr1 = new ComparableRectangle(2, 3);
		ComparableRectangle cr2 = new ComparableRectangle(2, 4);
		System.out.println(cr1.compareTo(cr2)); 
		System.out.println(max(cr1, cr2));
	}

}
